{extend name='admin@public/content'}

{block name="content"}
<form autocomplete="off" onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='form-horizontal layui-form padding-top-20'>

    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <div class="form-group">
                    <label class="col-sm-2 control-label">手机号</label>
                    <div class='col-sm-8'>
                        <input autofocus name="content[mobile]" value='{$vo.content.mobile|default=""}' required="required" title="请输入手机号" placeholder="请输入手机号" class="layui-input">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">状态</label>
                    <div class='col-sm-8'>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='-1'?'checked':''} value="-1" name="status"/> 未通过</label>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='0'?'checked':''} value="0" name="status"/> 待审核</label>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='1'?'checked':''} value="1" name="status"/> 已通过</label>
                    </div>
                </div>
                {if condition="$vo['type'] eq 1"}
                <!--个人认证-->
                <div class="form-group">
                    <label class="col-sm-2 control-label">姓名</label>
                    <div class='col-sm-8'>
                        <input autofocus name="content[name]" value='{$vo.content.name|default=""}' required="required" title="请输入姓名" placeholder="请输入姓名" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">身份证号码</label>
                    <div class='col-sm-8'>
                        <input autofocus name="content[card_num]" value='{$vo.content.card_num|default=""}' required="required" title="请输入身份证号码" placeholder="请输入身份证号码" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">认证信息</label>
                    <div class='col-sm-8'>
                        <input autofocus name="content[desc]" value='{$vo.content.desc|default=""}' required="required" title="请输入认证信息" placeholder="请输入认证信息" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label label-required">手持身份证</label>
                    <div class='col-sm-8'>
                        <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                            <thead>
                            <tr>
                                <td>手持身份证</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td class="text-top" style="width:100px">
                                    <input type="hidden" class="hand_card" name="content[hand_card]" value="{$vo.content.hand_card|default=''}">
                                    <script>$('[class=hand_card]').uploadOneImage()</script>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label label-required">身份证国徽面</label>
                    <div class='col-sm-8'>
                        <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                            <thead>
                            <tr>
                                <td>身份证国徽面</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td class="text-top" style="width:100px">
                                    <input type="hidden" class="card_back" name="content[card_back]" value="{$vo.content.card_back|default=''}">
                                    <script>$('[class=card_back]').uploadOneImage()</script>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                {else/}
                    <!--企业认证-->
                <div class="form-group">
                    <label class="col-sm-2 control-label">主体名称</label>
                    <div class='col-sm-8'>
                        <input autofocus name="content[name]" value='{$vo.content.name|default=""}' required="required" title="请输入主体名称" placeholder="请输入主体名称" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">主体类型</label>
                    <div class='col-sm-8'>
                        <input autofocus name="content[subject_type]" value='{$vo.content.subject_type|default=""}' required="required" title="请输入主体类型" placeholder="请输入主体类型" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">营业执照号</label>
                    <div class='col-sm-8'>
                        <input autofocus name="content[license_num]" value='{$vo.content.license_num|default=""}' required="required" title="请输入营业执照号" placeholder="请输入营业执照号" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label label-required">营业执照</label>
                    <div class='col-sm-8'>
                        <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                            <thead>
                            <tr>
                                <td>营业执照</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td class="text-top" style="width:100px">
                                    <input type="hidden" class="license" name="content[license]" value="{$vo.content.license|default=''}">
                                    <script>$('[class=license]').uploadOneImage()</script>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                {/if}
            </div>
        </div>
    </div>

    <div class="hr-line-dashed"></div>

    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            {if !empty($vo.id)}
            <input type="hidden" name="id" value="{$vo.id}">
            <input type="hidden" name="type" value="{$vo.type}">
            {/if}
            <button class="layui-btn" type="submit">保存</button>
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消</button>
        </div>
    </div>

    <style>
        .background-item {
            padding: 15px;
            background: #efefef;
        }
        .no_border{border:none;}
        .background-item thead tr {
            background: #e0e0e0
        }
    </style>
    <script>
        window.form.render();
        layui.use('laydate', function(){
            var laydate = layui.laydate;

            laydate.render({
                elem: 'input[name=birthday]',
                btns: ['now', 'confirm']
            });
            laydate.render({
                elem: 'input[name=expiry_time]',
                type: 'datetime',
                btns: ['now', 'confirm']
            });
        });
    </script>
</form>
{/block}